package com.example.yupao_project.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.yupao_project.entity.User;
import com.example.yupao_project.entity.param.UserInfoVo;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 杰
 * @description 针对表【user(用户)】的数据库操作Service
 * @createDate 2024-04-27 19:57:37
 */
@Service
public interface UserService extends IService<User> {


    /**
     * 注册功能
     *
     * @param userInfoVo 注册信息
     * @return ResultUtils
     */
    String register(UserInfoVo userInfoVo);

    /**
     * @param userAccount  账号
     * @param userPassword 密码
     * @param session      会话
     * @return ResultUtils
     */
    String login(String userAccount, String userPassword, HttpSession session);

    /**
     * 通过标签搜索用户
     *
     * @param tagList 标签
     * @return ResultUtils
     */
    List<User> searchUserByTags(List<String> tagList);

    /**
     * 更新用户信息
     *
     * @param user    用户信息
     * @param request request
     * @return ResultUtils
     */
    boolean updateUserInfo(User user, HttpServletRequest request);

    /**
     * 修改内容之后更新session
     *
     * @param user 用户信息
     * @return true / false
     */
    void updateSession(User user, HttpServletRequest request);

    List<User> matchUsers(long num, HttpServletRequest request);
}
